import 'package:flutter/material.dart';

class FlatPanel extends StatelessWidget {
  final double margin;
  final double padding;

  @required
  final Widget child;

  FlatPanel({this.margin: 16.0, this.padding: 16.0, this.child});

  @override
  Widget build(BuildContext context) {
    return Container(
      margin: EdgeInsets.all(margin),
      padding: EdgeInsets.all(padding),
      child: child,
    );
  }
}

class FlatScaffold extends StatelessWidget {
  final double margin;
  final double padding;
  @required
  final String entry;
  @required
  final Widget child;

  FlatScaffold(this.entry, {this.margin: 16.0, this.padding: 16.0, this.child});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(entry),
      ),
      body: FlatPanel(child: child),
    );
  }
}
